<template>
  <view class="home">
    <view class="record-item" v-for="(item,index) in list" :key="item.id">
      <u-text :text="item.prize_name" size="14" color="#000"></u-text>
      <u-text :text="item.createtime" size="12" color="#666"></u-text>
    </view>
  </view>
</template>

<script setup>
  import { onMounted, ref } from 'vue';
  import { onReachBottom } from '@dcloudio/uni-app'
  import { user_prize } from '../../config/api';
  const params = ref({
    page: 1,
    limit: 15
  })
  const list = ref([])
  onReachBottom(() => {
    params.value.page++
    _user_prize()
  })
  onMounted(() => {
    _user_prize()
  })
  // 中奖记录
  const _user_prize = () => {
    user_prize().then(res => {
      if (params.value.page == 1) list.value = res.data.data
      else list.value = live.value.concat(res.data.data)
    })
  }
</script>

<style scoped lang="scss">
  .home {
    padding: 0 24rpx;
    min-height: 100vh;
    background: #fff;
  }

  .record-item {
    padding: 32rpx 4rpx;
    border-bottom: 1px solid rgba(0, 0, 0, .12);
  }
</style>